<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@include file="/common.jsp"%>
<!DOCTYPE html>
<html lang="zh">
<meta charset="utf-8">
<head></head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								纳税人：
								<input type="text" name="taxpayerName" />
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()">
									<i class="fa fa-search"></i>
									&nbsp;查询
								</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()">
									<i class="fa fa-refresh"></i>
									&nbsp;重置
								</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	<script th:inline="javascript">
		var prefix = "${ctx}/system/ledger";
	
		$(function() {
			var options = {
				url : prefix + "/statisticList",
				createUrl : prefix + "/add",
				updateUrl : prefix + "/edit/{id}",
				modalName : "账薄",
				search : false,
				showExport : true,
				columns : [ {
					checkbox : true
				},
					{
						field : 'taxpayerName',
						title : '纳税人',
					},
					{
						field : 'taxpayerCompanyName',
						title : '公司名称',
					},
					{
						field : 'taxpayerNumber',
						title : '纳税人识别号',
					},
					{
						title : '操作',
						align : 'center',
						formatter : function(value, row, index) {
							var actions = [];
							actions.push('<a class="btn btn-success btn-xs " href="#" onclick="doList( \'' + row.taxpayerName + '\' ,\'' + row.taxpayerId + '\')"><i class="fa fa-edit"></i>查看总账</a> ');
							return actions.join('');
						}
					} ]
			};
			$.table.init(options);
		});
	
		function doList(taxpayerName, taxpayerId) {
			window.location.href = "${ctx}/system/ledger/list?taxpayerName=" + taxpayerName + "&ledgerTaxpayer=" + taxpayerId;
		}
	</script>
</body>
</html>